package com.keepers.repair.service;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.keepers.repair.net.LogUtil;

/**
 * auth aboom
 * date 2018/12/8
 */
public class ScreenBroadcastReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        LogUtil.e("SreenLckReceiver-->监听到系统广播：" + action);
        if (Intent.ACTION_SCREEN_ON.equals(action)) {         // 开屏

        } else if (Intent.ACTION_SCREEN_OFF.equals(action)) {  // 锁屏

        } else if (Intent.ACTION_USER_PRESENT.equals(action)) { // 解锁
            Intent mIntent = new Intent(context, SocketService.class);
            context.startService(mIntent);
        }
    }
}
